from django.db import models

from myuser.models import MyUser
from prj005.models.info import Info
from prj005.models.models import CreateTimeModel


class History(CreateTimeModel):
    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj005_history')

    info = models.OneToOneField(Info, on_delete=models.CASCADE, related_name='history')

    vagina_wai = models.BooleanField(blank=True, null=True, verbose_name='外阴阴道假丝酵母菌病', help_text='外阴阴道假丝酵母菌病')

    vagina_xi = models.BooleanField(blank=True, null=True, verbose_name='细菌性阴道病', help_text='细菌性阴道病')

    vagina_hun = models.BooleanField(blank=True, null=True, verbose_name='混合性阴道炎', help_text='混合性阴道炎')

    # vagina_xu = models.BooleanField(blank=True, null=True, verbose_name='需氧菌性阴道炎', help_text='需氧菌性阴道炎')

    vagina_di = models.BooleanField(blank=True, null=True, verbose_name='滴虫性阴道炎', help_text='滴虫性阴道炎')

    vagina_lao = models.BooleanField(blank=True, null=True, verbose_name='老年性阴道炎', help_text='老年性阴道炎')

    sex_lin = models.BooleanField(blank=True, null=True, verbose_name='淋球菌感染', help_text='淋球菌感染')

    sex_sha = models.BooleanField(blank=True, null=True, verbose_name='沙眼衣原体感染', help_text='沙眼衣原体感染')

    sex_jie = models.BooleanField(blank=True, null=True, verbose_name='解脲支原体感染', help_text='解脲支原体感染')

    sex_sheng = models.BooleanField(blank=True, null=True, verbose_name='生殖支原体感染', help_text='生殖支原体感染')

    sex_ren = models.BooleanField(blank=True, null=True, verbose_name='人型支原体感染', help_text='人型支原体感染')

    sex_hpv = models.BooleanField(blank=True, null=True, verbose_name='HPV感染', help_text='HPV感染')

    sex_zhi = models.BooleanField(blank=True, null=True, verbose_name='生殖器疱疹', help_text='生殖器疱疹')

    urinary_niao = models.BooleanField(blank=True, null=True, verbose_name='尿道炎', help_text='尿道炎')

    urinary_pang = models.BooleanField(blank=True, null=True, verbose_name='膀胱炎', help_text='膀胱炎')

    urinary_shen = models.BooleanField(blank=True, null=True, verbose_name='肾盂肾炎', help_text='肾盂肾炎')

    others_lan = models.BooleanField(blank=True, null=True, verbose_name='阑尾炎', help_text='阑尾炎')

    others_ji = models.BooleanField(blank=True, null=True, verbose_name='急性腹膜炎', help_text='急性腹膜炎')

    others_pen = models.BooleanField(blank=True, null=True, verbose_name='盆腔结核', help_text='盆腔结核')

    others_jie = models.BooleanField(blank=True, null=True, verbose_name='结肠憩室炎', help_text='结肠憩室炎')

    wu_operation_gong = models.BooleanField(blank=True, null=True, verbose_name='宫腔手术操作史-无', help_text='宫腔手术操作史-无')

    operation_gong = models.BooleanField(blank=True, null=True, verbose_name='宫腔手术操作史', help_text='宫腔手术操作史')

    operation_gong_ren = models.BooleanField(blank=True, null=True, verbose_name='人工流产术', help_text='人工流产术')

    operation_gong_gua = models.BooleanField(blank=True, null=True, verbose_name='诊断性刮宫术', help_text='诊断性刮宫术')

    operation_gong_qing = models.BooleanField(blank=True, null=True, verbose_name='清宫术', help_text='清宫术')

    operation_gong_zhi = models.BooleanField(blank=True, null=True, verbose_name='节育器置入术', help_text='节育器置入术')

    operation_gong_qu = models.BooleanField(blank=True, null=True, verbose_name='节育器取出术', help_text='节育器取出术')

    operation_gong_tong = models.BooleanField(blank=True, null=True, verbose_name='子宫输卵管通液术', help_text='子宫输卵管通液术')

    operation_gong_zao = models.BooleanField(blank=True, null=True, verbose_name='子宫输卵管造影术', help_text='子宫输卵管造影术')

    operation_gong_gong = models.BooleanField(blank=True, null=True, verbose_name='宫腔镜检查', help_text='宫腔镜检查')

    operation_gong_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='宫腔镜检查', help_text='宫腔镜检查')

    wu_operation_pen = models.BooleanField(blank=True, null=True, verbose_name='盆腔手术史-无', help_text='盆腔手术史-无')

    operation_pen = models.BooleanField(blank=True, null=True, verbose_name='盆腔手术史', help_text='盆腔手术史')

    operation_pen_fujian = models.BooleanField(blank=True, null=True, verbose_name='附件切除术', help_text='附件切除术')

    operation_pen_chu = models.BooleanField(blank=True, null=True, verbose_name='子宫切除术', help_text='子宫切除术')

    operation_pen_jia = models.BooleanField(blank=True, null=True, verbose_name='全子宫加双附件切除术', help_text='全子宫加双附件切除术')

    operation_pen_wa = models.BooleanField(blank=True, null=True, verbose_name='子宫肌瘤挖除术', help_text='子宫肌瘤挖除术')

    # operation_pen_tong = models.BooleanField(blank=True, null=True, verbose_name='输卵管通液术', help_text='输卵管通液术')

    operation_pen_jie = models.BooleanField(blank=True, null=True, verbose_name='输卵管结扎术', help_text='输卵管结扎术')

    operation_pen_luan = models.BooleanField(blank=True, null=True, verbose_name='卵巢囊肿剥除术', help_text='卵巢囊肿剥除术')

    operation_pen_fennian = models.BooleanField(blank=True, null=True, verbose_name='盆腔分粘术', help_text='盆腔分粘术')

    # operation_pen_yiwei = models.BooleanField(blank=True, null=True, verbose_name='子宫内膜异位症手术', help_text='子宫内膜异位症手术')

    operation_pen_lawei = models.BooleanField(blank=True, null=True, verbose_name='阑尾切除术', help_text='阑尾切除术')

    operation_pen_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='其他', help_text='其他')

    sex_life = models.BooleanField(blank=True, null=True, verbose_name='性生活', help_text='性生活')

    wu_sex_life = models.BooleanField(blank=True, null=True, verbose_name='性生活-无', help_text='性生活-无')
    SLFTC = (
        ('＜18岁', '＜18岁'),
        ('≥18岁', '≥18岁')
    )
    sex_life_first_time = models.CharField(max_length=8, choices=SLFTC, blank=True, null=True, verbose_name='初次性生活年龄', help_text='初次性生活年龄')

    SLC = (
        ('固定', '固定'),
        ('不固定', '不固定')
    )
    sex_lover = models.CharField(max_length=4, choices=SLC, blank=True, null=True, verbose_name='性伴侣', help_text='性伴侣')

    SLNC = (
        ('1', '1'),
        ('2', '2'),
        ('≥3', '≥3')
    )
    sex_lover_number = models.CharField(max_length=4, choices=SLNC, blank=True, null=True, verbose_name='性伴侣个数', help_text='性伴侣个数')

    SLTC = (
        ('＜1次/周', '＜1次/周'),
        ('1-3次/周', '1-3次/周'),
        ('＞3次/周', '＞3次/周')
    )
    sex_life_times = models.CharField(max_length=8, choices=SLTC, blank=True, null=True, verbose_name='性生活频次', help_text='性生活频次')

    wu_sex_lover_disease = models.BooleanField(blank=True, null=True, verbose_name='性伴侣是否伴有性传播疾病-否', help_text='性伴侣是否伴有性传播疾病-否')

    sex_lover_disease = models.BooleanField(blank=True, null=True, verbose_name='性伴侣是否伴有性传播疾病', help_text='性伴侣是否伴有性传播疾病')

    contraception_tao = models.BooleanField(blank=True, null=True, verbose_name='避孕套', help_text='避孕套')

    contraception_qi = models.BooleanField(blank=True, null=True, verbose_name='宫内节育器', help_text='宫内节育器')

    contraception_shuan = models.BooleanField(blank=True, null=True, verbose_name='避孕栓', help_text='避孕栓')

    contraception_mo = models.BooleanField(blank=True, null=True, verbose_name='阴道隔膜', help_text='阴道隔膜')

    contraception_an = models.BooleanField(blank=True, null=True, verbose_name='安全期避孕', help_text='安全期避孕')

    contraception_wai = models.BooleanField(blank=True, null=True, verbose_name='体外射精', help_text='体外射精')

    contraception_ji = models.BooleanField(blank=True, null=True, verbose_name='激素避孕药', help_text='激素避孕药')

    contraception_kou = models.BooleanField(blank=True, null=True, verbose_name='口服短效避孕药', help_text='口服短效避孕药')

    contraception_chang = models.BooleanField(blank=True, null=True, verbose_name='长效避孕药', help_text='长效避孕药')

    contraception_jin = models.BooleanField(blank=True, null=True, verbose_name='紧急避孕药', help_text='紧急避孕药')

    contraception_zhen = models.BooleanField(blank=True, null=True, verbose_name='避孕针', help_text='避孕针')

    contraception_pi = models.BooleanField(blank=True, null=True, verbose_name='皮下埋植入剂', help_text='皮下埋植入剂')

    contraception_yin = models.BooleanField(blank=True, null=True, verbose_name='阴道药环', help_text='阴道药环')

    contraception_pian = models.BooleanField(blank=True, null=True, verbose_name='避孕贴片', help_text='避孕贴片')

    contraception_han = models.BooleanField(blank=True, null=True, verbose_name='含药的宫内节育器', help_text='含药的宫内节育器')

    contraception_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='避孕措施-其他', help_text='避孕措施-其他')

    BAD_CHOICES = (
        ('偶尔', '偶尔'),
        ('有时', '有时'),
        ('经常', '经常')
    )

    bad_jingqi = models.BooleanField(blank=True, null=True, verbose_name='经期同房', help_text='经期同房')

    wu_bad_jingqi = models.BooleanField(blank=True, null=True, verbose_name='经期同房-无', help_text='经期同房-无')

    bad_jingqi_exist = models.CharField(max_length=4, choices=BAD_CHOICES, blank=True, null=True, verbose_name='经期同房-有', help_text='经期同房-有')

    bad_chanru = models.BooleanField(blank=True, null=True, verbose_name='产褥期同房', help_text='产褥期同房')

    wu_bad_chanru = models.BooleanField(blank=True, null=True, verbose_name='产褥期同房-无', help_text='产褥期同房-无')

    bad_chanru_exist = models.CharField(max_length=4, choices=BAD_CHOICES, blank=True, null=True, verbose_name='产褥期同房-有', help_text='产褥期同房-有')

    bad_liuchan = models.BooleanField(blank=True, null=True, verbose_name='流产后同房', help_text='流产后同房')

    wu_bad_liuchan = models.BooleanField(blank=True, null=True, verbose_name='流产后同房-无', help_text='流产后同房-无')

    bad_liuchan_exist = models.CharField(max_length=4, choices=BAD_CHOICES, blank=True, null=True, verbose_name='流产后同房-有', help_text='流产后同房-有')

    bad_bujie = models.BooleanField(blank=True, null=True, verbose_name='经期使用不洁卫生巾', help_text='经期使用不洁卫生巾')

    wu_bad_bujie = models.BooleanField(blank=True, null=True, verbose_name='经期使用不洁卫生巾-无', help_text='经期使用不洁卫生巾-无')

    bad_yindao = models.BooleanField(blank=True, null=True, verbose_name='阴道冲洗器使用', help_text='阴道冲洗器使用')

    wu_bad_yindao = models.BooleanField(blank=True, null=True, verbose_name='阴道冲洗器使用-无', help_text='阴道冲洗器使用-无')

    bad_yindao_exist = models.CharField(max_length=4, choices=BAD_CHOICES, blank=True, null=True, verbose_name='阴道冲洗器使用-有', help_text='阴道冲洗器使用-有')

    bad_yindao_exist_times = models.IntegerField(blank=True, null=True, verbose_name='阴道冲洗器使用-次数', help_text='阴道冲洗器使用-次数')

    class Meta:
        verbose_name = '相关病史'
        verbose_name_plural = verbose_name
